package com.wnxy.pms.product.core.config;


import com.wnxy.pms.product.core.dto.OrderPayDto;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class OrderProducer {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendOrder(OrderPayDto orderDto){
        rabbitTemplate.convertAndSend(
                "order-exchange","order."+orderDto.getOrderSn(),orderDto);
    }
}
